﻿using System;
using System.Web.Mvc;
using easyccms.BusinessLayer.Repositories;
using easyccms.WebUI.Areas.Administrator.Models;
using easyccms.WebUI.Infrastructure;

namespace easyccms.WebUI.Areas.Administrator.Controllers
{
    public class UserGroupController : Controller, IAdminController
    {
        public IUserGroupRepository _userGroupRepository
        {
            get { return DependencyInjector.Resolve<IUserGroupRepository>(); }
        }

        public UserGroupController()
        {
            
        }

        //
        // GET: /Administrator/UserGroup/

        public ActionResult Index()
        {
            UserGroupListModel userGroupListModel = new UserGroupListModel {UserGroups = this._userGroupRepository.All};
            return View(userGroupListModel);
        }

      
        //
        // GET: /Administrator/UserGroup/Create

        public ActionResult Create()
        {
            //return View();
            throw new NotImplementedException();
        } 

        //
        // POST: /Administrator/UserGroup/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
               // return View();
            }
            throw new NotImplementedException();
        }
        
        //
        // GET: /Administrator/UserGroup/Edit/5
 
        public ActionResult Edit(int id)
        {
           // return View();
            throw new NotImplementedException();
        }

        //
        // POST: /Administrator/UserGroup/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                //return View();
            }
            throw new NotImplementedException();
        }

        //
        // GET: /Administrator/UserGroup/Delete/5
 
        public ActionResult Delete(int id)
        {
            //return View();
            throw new NotImplementedException();
        }

        //
        // POST: /Administrator/UserGroup/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
 
                return RedirectToAction("Index");
            }
            catch
            {
                //return View();
            }

            throw new NotImplementedException();
        }




        public ActionResult MoveToBin(int id)
        {
            throw new NotImplementedException();
        }

        public ActionResult Enable(int id)
        {
            throw new NotImplementedException();
        }

        public ActionResult Disable(int id)
        {
            throw new NotImplementedException();
        }

        public ActionResult GetLastChanged(int noOfChanged)
        {
            throw new NotImplementedException();
        }

        public ActionResult Bin()
        {
            return View();
        }

        public ActionResult BinDelete(int id)
        {
            TempData["SelectedTab"] = "UserGroup";
            throw new NotImplementedException();
        }

        public ActionResult BinRestore(int id)
        {
            TempData["SelectedTab"] = "UserGroup";
            throw new NotImplementedException();
        }
    }
}
